package com.etc.traval.bizimpl;

import java.util.List;

import com.etc.traval.biz.ComplaintBiz;
import com.etc.traval.dao.ComplaintDao;
import com.etc.traval.daoimpl.ComplaintDaoImpl;
import com.etc.travel.entity.Complaint;

public class ComplaintBizImpl implements ComplaintBiz{

	ComplaintDao dao = new ComplaintDaoImpl();
	@Override
	public boolean addComplaint(Complaint complaint) {
		if(complaint==null){
			return false;
		}
		if(complaint.getComplaint_user()==null){
			return false;
		}
		if(complaint.getComplaint_content()==null||complaint.getComplaint_content().equals("")){
			return false;
		}
		
		return dao.addComplaint(complaint);
	}
	@Override
	public boolean updateCompStatusById(int id) {
		if(id<10000){
			return false;
		}
		return dao.updateCompStatusById(id);
	}
	@Override
	public boolean deleteCompById(int id) {
		if(id<10000){
			return false;
		}
		return dao.deleteCompById(id);
	}
	@Override
	public List<Complaint> queryCompByPage(int size, int pages) {
		return dao.queryCompByPage(size, pages);
	}
	@Override
	public Complaint queryComplaintById(int id) {
		if(id<10000){
			return null;
		}
		return dao.queryComplaintById(id);
	}
	@Override
	public List<Complaint> queruCompByUserIdAndPage(int size, int pages, int userid) {
		if(userid<10000){
			return null;
		}
		return dao.queruCompByUserIdAndPage(size, pages, userid);
	}

}
